package com.rainfull.ui;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.widget.Toast;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.MapController;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
import com.google.android.maps.GeoPoint;
import com.rainfull.core.RAPItemInfo;
import com.rainfull.core.RNetworkProcess;
import com.rainfull.core.RUploadApResult;
import com.rainfull.util.json.JSONObject;


public class RUIGMap extends MapActivity 
{
	private MapView mapView;    
	private RNetworkProcess m_networkProcess = null; 
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {        
        super.onCreate(savedInstanceState);
        setContentView(R.layout.map);        
        mapView = (MapView) findViewById(R.id.map_view);       
        mapView.setBuiltInZoomControls(true);       
        List<Overlay> mapOverlays = mapView.getOverlays();
        Drawable drawable = RUIGMap.this.getResources().getDrawable(R.drawable.icon);
        MapController mapController = mapView.getController();
        main mainActive = (main)RUIGMap.this.getParent(); 
       // int nSize = listMapItem.size();        
        RAPItemInfo mapItemInfo = null;
        /*for (int i = 0; i <  0; i++)
        {
        	mapItemInfo = listMapItem.get(i); 
        	if (mainActive.m_APMgr != null)
        	{
        		mainActive.m_APMgr.UpdateApPosInfo(mapItemInfo);        	
	        	if (mapItemInfo.getPwd().length() != 0)
	        	{
	        		String strDes = mapItemInfo.getDes();        	
		        	RUIGMapItemOverlay itemizedOverlay = new RUIGMapItemOverlay(drawable, this);
		
		            GeoPoint point = new GeoPoint((int)(mapItemInfo.getLatitude().doubleValue()* 1e6), 
		            		(int)(mapItemInfo.getLongitude().doubleValue()* 1e6));
		            //OverlayItem overlayitem = new OverlayItem(point, mapItemInfo.getScanRes().BSSID, mapItemInfo.getDes());            
		            //itemizedOverlay.addOverlay(overlayitem);
		            //mapOverlays.add(itemizedOverlay);
		            mapController.animateTo(point);
	        	}
        	}
        }   */  
        mapController.setZoom(14);            
    }
	@Override
	protected boolean isRouteDisplayed() 
	{
		// TODO Auto-generated method stub
		return false;
	}
	 //后台获取ap周围的免费ap列表信息用户在界面上显示
	public class RUIGetApListBySvr extends AsyncTask
	{
		@Override
		protected Object doInBackground(Object... param) 
		{				
			
			return null;			
		}
		protected void onPostExecute(Object result) 
		{  									
		}
	}
}
